<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>api_shim.core.net.NetClient</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;api_shim ::
        <a href="api_shim.core-module.html">Package&nbsp;core</a> ::
        <a href="api_shim.core.net-module.html">Module&nbsp;net</a> ::
        Class&nbsp;NetClient
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="api_shim.core.net.NetClient-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class NetClient</h1><p class="nomargin-top"><span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient">source&nbsp;code</a></span></p>
<pre class="base-tree">
              object --+        
                       |        
  <a href="api_shim.core.ssl_support.SSLSupport-class.html">ssl_support.SSLSupport</a> --+    
                           |    
                  object --+    
                           |    
<a href="api_shim.core.ssl_support.ClientSSLSupport-class.html">ssl_support.ClientSSLSupport</a> --+
                               |
                  object --+   |
                           |   |
      <a href="api_shim.core.tcp_support.TCPSupport-class.html">tcp_support.TCPSupport</a> --+
                               |
                              <strong class="uidshort">NetClient</strong>
</pre>

<hr />
<p>NetClient is an asynchronous factory for TCP or SSL connections.</p>
  <p>Multiple connections to different servers can be made using the same 
  instance.</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="api_shim.core.net.NetClient-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">**kwargs</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="api_shim.core.net.NetClient-class.html#connect" class="summary-sig-name">connect</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">port</span>,
        <span class="summary-sig-arg">host</span>,
        <span class="summary-sig-arg">handler</span>)</span><br />
      Attempt to open a connection to a server.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient.connect">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="api_shim.core.net.NetClient-class.html#set_reconnect_attempts" class="summary-sig-name">set_reconnect_attempts</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">val</span>)</span><br />
      Set the number of reconnection attempts.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient.set_reconnect_attempts">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="get_reconnect_attempts"></a><span class="summary-sig-name">get_reconnect_attempts</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Get the number of reconnect attempts</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient.get_reconnect_attempts">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="set_reconnect_interval"></a><span class="summary-sig-name">set_reconnect_interval</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">val</span>)</span><br />
      Set the reconnect interval, in milliseconds</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient.set_reconnect_interval">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="get_reconnect_interval"></a><span class="summary-sig-name">get_reconnect_interval</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Get the reconnect interval, in milliseconds.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient.get_reconnect_interval">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="set_connect_timeout"></a><span class="summary-sig-name">set_connect_timeout</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">val</span>)</span><br />
      Set the connect timeout in milliseconds.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient.set_connect_timeout">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="get_connect_timeout"></a><span class="summary-sig-name">get_connect_timeout</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns the connect timeout in milliseconds</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient.get_connect_timeout">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="api_shim.core.net.NetClient-class.html#close" class="summary-sig-name">close</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Close the NetClient.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient.close">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="api_shim.core.ssl_support.ClientSSLSupport-class.html">ssl_support.ClientSSLSupport</a></code></b>:
      <code><a href="api_shim.core.ssl_support.ClientSSLSupport-class.html#get_trust_all">get_trust_all</a></code>,
      <code><a href="api_shim.core.ssl_support.ClientSSLSupport-class.html#set_trust_all">set_trust_all</a></code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="api_shim.core.ssl_support.SSLSupport-class.html">ssl_support.SSLSupport</a></code></b>:
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#get_key_store_password">get_key_store_password</a></code>,
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#get_key_store_path">get_key_store_path</a></code>,
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#get_ssl">get_ssl</a></code>,
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#get_trust_store_password">get_trust_store_password</a></code>,
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#get_trust_store_path">get_trust_store_path</a></code>,
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#set_key_store_password">set_key_store_password</a></code>,
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#set_key_store_path">set_key_store_path</a></code>,
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#set_ssl">set_ssl</a></code>,
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#set_trust_store_password">set_trust_store_password</a></code>,
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#set_trust_store_path">set_trust_store_path</a></code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="api_shim.core.tcp_support.TCPSupport-class.html">tcp_support.TCPSupport</a></code></b>:
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#get_receive_buffer_size">get_receive_buffer_size</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#get_reuse_address">get_reuse_address</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#get_send_buffer_size">get_send_buffer_size</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#get_so_linger">get_so_linger</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#get_tcp_keep_alive">get_tcp_keep_alive</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#get_tcp_no_delay">get_tcp_no_delay</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#get_traffic_class">get_traffic_class</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#get_use_pooled_buffers">get_use_pooled_buffers</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#set_receive_buffer_size">set_receive_buffer_size</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#set_reuse_address">set_reuse_address</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#set_send_buffer_size">set_send_buffer_size</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#set_so_linger">set_so_linger</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#set_tcp_keep_alive">set_tcp_keep_alive</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#set_tcp_no_delay">set_tcp_no_delay</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#set_traffic_class">set_traffic_class</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#set_use_pooled_buffers">set_use_pooled_buffers</a></code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Class Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-ClassVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="api_shim.core.ssl_support.ClientSSLSupport-class.html">ssl_support.ClientSSLSupport</a></code></b>:
      <code><a href="api_shim.core.ssl_support.ClientSSLSupport-class.html#trust_all">trust_all</a></code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="api_shim.core.ssl_support.SSLSupport-class.html">ssl_support.SSLSupport</a></code></b>:
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#key_store_password">key_store_password</a></code>,
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#key_store_path">key_store_path</a></code>,
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#ssl">ssl</a></code>,
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#trust_store_password">trust_store_password</a></code>,
      <code><a href="api_shim.core.ssl_support.SSLSupport-class.html#trust_store_path">trust_store_path</a></code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="api_shim.core.tcp_support.TCPSupport-class.html">tcp_support.TCPSupport</a></code></b>:
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#receive_buffer_size">receive_buffer_size</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#reuse_address">reuse_address</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#send_buffer_size">send_buffer_size</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#so_linger">so_linger</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#tcp_keep_alive">tcp_keep_alive</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#tcp_no_delay">tcp_no_delay</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#traffic_class">traffic_class</a></code>,
      <code><a href="api_shim.core.tcp_support.TCPSupport-class.html#use_pooled_buffers">use_pooled_buffers</a></code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">**kwargs</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Overrides:
        object.__init__
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="connect"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">connect</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">port</span>,
        <span class="sig-arg">host</span>,
        <span class="sig-arg">handler</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient.connect">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Attempt to open a connection to a server. The connection is opened 
  asynchronously and the result returned in the handler.</p>
  <p>Keyword arguments:</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>port</code></strong> - The port to connect to.</li>
        <li><strong class="pname"><code>host</code></strong> - The host or ip address to connect to.</li>
        <li><strong class="pname"><code>handler</code></strong> - The connection handler</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a reference to self so invocations can be chained</dd>
  </dl>
</td></tr></table>
</div>
<a name="set_reconnect_attempts"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">set_reconnect_attempts</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">val</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient.set_reconnect_attempts">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Set the number of reconnection attempts. In the event a connection 
  attempt fails, the client will attempt to connect a further number of 
  times, before it fails. Default value is zero.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="close"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">close</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="api_shim.core.net-pysrc.html#NetClient.close">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Close the NetClient. Any open connections will be closed.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1
    on Wed Jul 17 20:24:59 2013
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>